package com.example.compsiteid;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;

@Entity
@Data
@Builder
@IdClass(UserInfoId.class)  //联合主键
@AllArgsConstructor
@NoArgsConstructor
public class UserInfo {
    //联合主键
    @Id
    private String name;
    @Id
    private String telephone;

    private Integer age;
}
